package symbol;

import llvmir.value.Value;

public abstract class Symbol {
    private final String name; // 符号名
    private final SymbolType type; // 符号类型

    private final int scopeLevel; // 符号所在层次
    private final int scopeNumber; // 符号所在层次编号
    private Value value;

    public Symbol(String name, SymbolType type, int scopeLevel, int scopeNumber) {
        this.name = name;
        this.type = type;
        this.scopeLevel = scopeLevel;
        this.scopeNumber = scopeNumber;
    }

    public String getName() {
        return name;
    }

    public SymbolType getType() {
        return type;
    }

    protected abstract String getTypeName();

    public int getScopeLevel() {
        return scopeLevel;
    }

    public int getScopeNumber() {
        return scopeNumber;
    }

    public Value getValue() {
        return value;
    }

    public void setValue(Value value) {
        this.value = value;
    }
}
